package com.xin.entity.crm;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xin.annoations.PhoneNumber;
import com.xin.entity.crm.easypoi.ExcelVerifyInfo;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@TableName("t_org_employee")
public class EmployEntity implements Serializable {

    @Excel(name = "用户id",orderNum = "1",width = 30)
    private Long id;

    @TableField(value = "username")
    @NotNull(message = "用户账号名不可以为空")
    @Excel(name = "用户名", orderNum = "2",width = 25)
    @NotBlank(message = "用户名不能为空")
    private String username;

    @TableField(value = "real_name")
    @NotNull(message =  "真实姓名不可以为空")
    @Excel(name = "真实姓名", orderNum = "3",width = 20)
    @NotBlank(message = "真实姓名不能为空")
    private String realName;

    @TableField(value = "email")
    @NotNull(message = "邮箱不可以为空")
    @Email(message = "邮箱格式错误")
    @Excel(name = "邮箱", orderNum = "4",width = 35)
    private String email;


    @TableField(value = "phone")
    @NotNull(message = "手机号不可以为空")
    @PhoneNumber
    @Excel(name =  "手机号", orderNum = "5",width = 35)
    private String phone;

    @TableField(value = "salt")
    private String salt;

    @TableField(value = "password")
    @NotNull(message = "手机号码不可以为空")
    private String password;

    @TableField(value = "age")
    @Excel(name = "年龄", orderNum = "6",width = 20)
    @NotNull(message = "年龄不可以为空")
    private Integer age;

    @TableField(value = "sex")
    @NotNull(message = "性别不可以为空")
    @Excel(name = "性别", orderNum = "7",width = 20,replace = {"男_1","女_0"})
    private Integer sex;

    /**
     * 1=正常 2=锁定 3=注销
     */
    @TableField(value = "state")
    @NotNull(message = "状态不可以为空")
    @Excel(name = "状态",orderNum = "8",width = 20,replace={"正常_1","锁定_2","注销_3"})
    private Integer state;

    @TableField(value = "department_id")
    @NotNull(message = "部门不可以为空")
    private Long departmentId;


    @TableField(exist = false)
    @Excel(name = "部门",orderNum = "9",width = 30)
    private String departmentName;

    @TableField(value =  "logininfo_id")
    private Long logininfoId;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Long getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(Long departmentId) {
        this.departmentId = departmentId;
    }

    public Long getLogininfoId() {
        return logininfoId;
    }

    public void setLogininfoId(Long logininfoId) {
        this.logininfoId = logininfoId;
    }

    public String getDepartmentName() {
        return departmentName;
    }

    public void setDepartmentName(String departmentName) {
        this.departmentName = departmentName;
    }

    @Override
    public String toString() {
        return "EmployEntity{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", realName='" + realName + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", salt='" + salt + '\'' +
                ", password='" + password + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                ", state=" + state +
                ", departmentId=" + departmentId +
                ", departmentName='" + departmentName + '\'' +
                ", logininfoId=" + logininfoId +
                '}';
    }
}
